import {http} from '@/utils/http'
import type {PageParams} from '@/utils/http/types'

export const deleteBorrowingUsers = (ids: number[]) => {
  return http.delete('/contract/borrowingUser', ids)
}

export const updateBorrowingUser = (data: BorrowingUser) => {
  return http.put('/contract/borrowingUser', data)
}

export const getBorrowingUser = (id: number) => {
  return http.get<Required<BorrowingUser>>(`/contract/borrowingUser/${id}`)
}

export const saveBorrowingUser = (data: BorrowingUser) => {
  return http.post('/contract/borrowingUser', data)
}

export const listBorrowingUsers = (pageParams?: PageParams, borrowingUser?: Partial<BorrowingUser>) => {
  return http.listPage<Required<BorrowingUser>>('/contract/borrowingUser', pageParams, borrowingUser)
}
